package com.suray.attendance.model.enums.erp.server;

import org.springframework.util.StringUtils;

public enum RequestServerProdEnum {
	自定义正式("YREPORT"),
	自定义测试("YTS"),
	OAPI正式("YMES"),
	OAPI测试("YOPAI");

	RequestServerProdEnum(String requestProd) {
		this.requestProd = requestProd;
	}
	String requestProd;

	public String getRequestProd() {
		return requestProd;
	}

	public void setRequestProd(String requestProd) {
		this.requestProd = requestProd;
	}


	/**
	* @Description: 注意 property 参数取默认小写驼峰
	* @Param: [requestProd, property]
	* @return: java.lang.String
	* @Author: jly
	* @Date: 2023/12/2
	*/
	public static String getHandleProperty(String requestProd,String property){
		if(StringUtils.isEmpty(requestProd)||StringUtils.isEmpty(property)){
			return null;
		}
		switch (requestProd){
			case "YREPORT":
			case "YTS":
				return com.suray.attendance.common.utils.StringUtils.toUnderscoreCase(property);
			case "YMES":
			case "YOPAI":
				return property;
		}
		return null;
	}

}
